package main

import "fmt"

//func
type Circle struct {
	radius float64
}

type integer int

func (c Circle) area() float64 {
	return 3.14 * c.radius * c.radius
}

func (i integer) print() {
	fmt.Println(i)
}

func (i *integer) set(n int) {
	*i = integer(n)
}

func (i *integer) String() string {
	str := fmt.Sprintf("xxxx [%d]", *i)
	return str
}
func main() {
	var c1 Circle = Circle{
		radius: 4.0,
	}
	area := c1.area()
	fmt.Println(area)

	var i integer = 33
	i.print()
	i.set(11)
	i.print()
	fmt.Println(&i) //返回 String方法里面的内容
}
